package com.bw.member.net

import androidx.lifecycle.MutableLiveData
import com.bw.common.vm.BaseViewModel
import com.bw.http.utils.zgr.OkHttpClientManager
import com.bw.member.entity.MemberEntity

class MemberViewModel:BaseViewModel() {

    val memberSuccess by lazy { MutableLiveData<MemberEntity>() }

    val apiService: ApiService = OkHttpClientManager.retrofitInstance.create(ApiService::class.java)

    fun getMember(userId: Int) {
        executeNotResNetwork(
            { apiService.getMember(userId) },
            memberSuccess::postValue
        )
    }
}